<template>
	<view>
		<view class="room_list">
			<view class="room_item " v-for="(item,index) in roomlist" :key="index" @tap="goroom(item)">
				<view class="radius_20 bg-white text-left">
					<!-- <image class="goods_logo" :src="item.posterimage" mode=""></image> -->
					<view class="goods_logo">
						<cs-image :option="item.posterimage"></cs-image>
						<view class="logo_info" >
							<view class="room_status">
								<text class="cu-tag bg-theme radius" v-if="item.livestatus==1">直播中</text>
								<text class="cu-tag bg-black radius" v-if="item.livestatus==0">主播休息</text>
							</view>
							<view class="user_info bg-shadeBottom flex align-center padding-lr-sm">
								<image class="user_avatar margin-right-sm round" :src="item.user.avatar" mode=""></image>
								<text class="text-white txt-22">{{item.user.nickname}}</text>
							</view>
						</view>
					</view>
					<view class="padding-xs padding-lr-sm">
						<view class="">
							<view class="cs_ellipsis_2 text-black000 txt-26 padding-tb-xs" >
								{{item.name}}
							</view>
						</view>
						<view class=" text-theme cs_ellipsis_2 txt-22">
							<text class="cuIcon-activity"></text>{{item.title}}
						</view>
						<view class="flex justify-between align-center">

						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import csImage from '@/components/cs-image.vue';
	export default {
		components:{
			csImage
		},
		props: {
		    roomlist: {
		        type: Array,
		        default: function() {
		            return []
		        }
		    }
		},
		data() {
			return {
				
			};
		},
		methods:{
			goroom(item){
				uni.navigateTo({
					url:'/pages/play/play?query='+encodeURIComponent(JSON.stringify(item))
				})
			}
		}
	}
</script>

<style>
	/* 房间列表 */
	.room_list{
		padding: 32rpx;
		column-count:2;
		column-gap: 26rpx;
	}
	.room_item{
		width: 330rpx;
		padding-bottom: 20rpx;
		break-inside: avoid;
		/* display: inline-block; */
		
	}
	.goods_logo{
		width: 330rpx;
		height: 330rpx;
		display: block;
		overflow: hidden;
		position: relative;
		
	}
	.logo_info{
		position: absolute;
		width: 100%;
		height: 100%;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
	}
	.user_info{
		position: absolute;
		height: 60rpx;
		width: 100%;
		bottom: 0;
		left: 0;
		right: 0;
		line-height: 60rpx;
	}
	.user_avatar{
		width: 32rpx;
		height: 32rpx;
	}
</style>
